package com.xm.service.background;

import com.xm.dao.background.MattersDao;
import com.xm.entity.Matters;
import com.xm.exception.SqlErrorException;

import java.util.List;

/**
 * 事项表Service
 * @author 康文程
 * @date 2024-1-22
 */
public class MattersService {
    private final MattersDao dao = new MattersDao();
    /**
     * 查询全部事项表
     * @return List<Matters> List对象
     * @throws SqlErrorException 抛出错误
     */
    public List<Matters> getAllMatters() throws SqlErrorException {
        return dao.getAllMatters();
    }
    /**
     * 根据事项ID删除对应的事项记录
     *
     * @param mattersId 事项ID
     * @return 是否删除成功
     * @throws SqlErrorException SQL执行异常
     */
    public boolean deleteMatterById(Integer mattersId) throws SqlErrorException {
        return dao.deleteMatterById(mattersId);
    }
}
